package pers.fulsun.demo.springcloud.controller;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * <p>编写一个FeignClient，使用注解@FeignClient指向前述项目的springcloud-client项目
 *
 * @author fulsun
 * @date 2021/9/11
 */
@FeignClient(value = "springcloud-client", name = "springcloud-client") //指向注册名为springcloud-client的服务
public interface TestFeignIntercept {
    /**
     * 内部接口，获取信息
     *
     * @return
     */
    @GetMapping("/test/feign/{id}")
    //指向springcloud-client中接口路径为/feign/test的接口
    Map getFeignMassage(@PathVariable("id") Long id);
}

